<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Dynamic Data - 2</title>

<script>

	function sampleFunction()
	{
		var $flag = document.getElementById("div1").style.visibility;
		
		if ($flag == "visible")
		{
			document.getElementById("div1").style.visibility = "hidden";
			document.getElementById("div2").style.visibility = "visible";
		}
		else
		{
			document.getElementById("div2").style.visibility = "hidden";
			document.getElementById("div1").style.visibility = "visible";
		}
	}

</script>

</head>

<body>
	<div id="div1" style="visibility:visible">
    	<p> Initial content </p>
    </div>
    <div>
    	<p id="div2" style="visibility:hidden"> Content Changed </p>
    </div>
    
	<input type="button" id="btn" value="click" onclick="sampleFunction()"/>
	
</body>

</html>
